package com.directv.z8training.ex1;

import java.util.List;

/**
 * @author HieuLT8
 *
 */
public class Pm extends Employee {

	protected List<Developer> listDeveloper;

	/**
	 * @param lastname
	 * @param firstname
	 * @param birthday
	 * @param sday
	 * @param taxcode
	 * @param salary
	 * @param lunch
	 */
	public Pm(String lastname, String firstname, String birthday, String sday,
			String taxcode, long salary, long lunch) {
		super(lastname, firstname, birthday, sday, taxcode, salary, lunch);
		// TODO Auto-generated constructor stub
	}

	@Override
	public long calcBouns() {
		bouns = (long) (salary * 0.1 + listDeveloper.size() * 100000);
		return bouns;
	}

	public List<Developer> getListDeveloper(List<Developer> list) {
		return listDeveloper;
	}

	public void setListDeveloper(List<Developer> listDeveloper) {
		this.listDeveloper = listDeveloper;
	}

	@SuppressWarnings("static-access")
	public void showDevelopers(List<Developer> listDeveloper) {
		System.out.println("All developers are: ");
		for (int i = 0; i < listDeveloper.size(); i++) {
			System.out.println("Last Name: "
					+ listDeveloper.get(i).getLastName());
			System.out.println("First Name: "
					+ listDeveloper.get(i).getFirstName());
			System.out.println("Birthday: "
					+ listDeveloper.get(i).getBirthday());
			System.out.println("Start working day: "
					+ listDeveloper.get(i).getStartWorkingDay());
			System.out.println("Company: "
					+ listDeveloper.get(i).getCompanyname());
			System.out.println("Salary: " + listDeveloper.get(i).getSalary());
			System.out.println("Main Language: "
					+ listDeveloper.get(i).getMainLanguage());
			System.out.println("Lunch: " + listDeveloper.get(i).getLunch());
			System.out.println("Bouns: " + listDeveloper.get(i).calcBouns());
			System.out.println("Total: " + (listDeveloper.get(i).calcBouns() + listDeveloper.get(i).getSalary() +  listDeveloper.get(i).getLunch()));
			System.out.println("============================================");
		}
	}

	@SuppressWarnings("static-access")
	public void showPm(Pm pm) {
		System.out.println("Our PM is");
		System.out.println("Last Name: " + pm.getLastName());
		System.out.println("First Name: " + pm.getFirstName());
		System.out.println("Birthday: " + pm.getBirthday());
		System.out.println("Start working day: " + pm.getStartWorkingDay());
		System.out.println("Company" + pm.getCompanyname());
		System.out.println("Salary: " + pm.getSalary());
		System.out.println("Lunch: " + pm.getLunch());
		System.out.println("Bouns: " + pm.calcBouns());
		System.out.println("Total: " + (pm.calcBouns() + pm.getSalary() + pm.getLunch()) );
	}

}
